<li id="post-<?php the_ID(); ?>" <?php post_class("clearfix"); ?>>
	
    <?php   $parentscategory = "";
            $otherparentscategory = "";
            foreach((get_the_category()) as $category) {
                if ($category->category_parent != 0) {
                    $parentscategory .= $category->name . ', ';
                }else {
                    $otherparentscategory .= $category->name . ', ';
                }
            }
            if ( strlen($parentscategory)== 0) {
                $parentscategory = $otherparentscategory;
            }
    ?>
    
    <?php if( has_post_thumbnail() ) { ?>
        <div class="post-image">
            <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
                <?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'image-style4' ); ?>
                <?php echo '<img src="' . $src[0] . '" alt="" />'; ?>
            </a>
            <span class="post-category"><?php echo substr($parentscategory,0,-2); ?></span>
        </div>
    <?php } else { ?>
            <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
                    <?php echo '<img src="' . get_template_directory_uri() . '/images/image1.png" alt="" />'; ?>
            </a>		
    <?php } ?>
	
    <h3>
        <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
        <span class="article-meta clearfix">
            <span class="article-date"><?php the_time('j F, Y'); ?></span>
            <span class="article-comments"><?php comments_popup_link( 
				__( '0 Comments', 'qns' ), 
				__( '1 Comment', 'qns' ), 
				__( '% Comments', 'qns' ), 
				'',
				__( '<span class="comments-off">Off</span>','qns')
			); ?>
            </span>
        </span>
    </h3>
	
    <?php print_excerpt(190); ?>
	
</li>